# -*- coding: utf-8 -*-
"""
Created on Sat Mar 13 22:13:40 2021

@author: xiaoyifu
"""

import os
import pandas as pd 
import numpy as np


RNA=np.load('./RNA/node2vec/RNA_embedding.npy',encoding = "latin1",allow_pickle=True) #加载文件 mRNA_lncRNA_embedding_new1.npy
doc = open('1.txt', 'a')  #打开一个存储文件，并依次写入
print(RNA, file=doc) 

RNA_dict=RNA.item()

RNA={}
RNA_embedding=pd.DataFrame()
for key in RNA_dict.keys():
    RNA[key]=''
    for i in range(128):
        RNA[key]=RNA[key]+str(RNA_dict[key][i])+' '

RNA_embedding=pd.DataFrame.from_dict(data=RNA,orient='index')
path_or_buf="../data/embedding/RNA_embedding.csv"
RNA_embedding.to_csv(path_or_buf,header=False,index=True,sep="\t")
